/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package be.hogent.iii.project.gui;


import be.hogent.iii.project.common.game.objecten.Spel;
import java.awt.Cursor;
import java.awt.Image;
import java.awt.Point;
import java.awt.Toolkit;
import java.io.File;
import java.util.Properties;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;

/**
 *
 * @author Caribou
 */
public class VeranderCursor {

    private Cursor aanvalsCursor;
    private Cursor beweegCursor;
    private Cursor nietToegelatenCursor;
    private Cursor selecteerCursor;
    private Properties props;
    private Spel spel;

    public VeranderCursor(Properties props, Spel spel) {
        this.props = props;
        this.spel = spel;
        aanvalsCursor = maakAanvalsCursor(props);
        beweegCursor = maakBeweegCursor(props);
        nietToegelatenCursor = maakNietToegelatenCursor(props);
        selecteerCursor = maakSelecteerCursor(props);
    }

    public static Cursor maakAanvalsCursor(Properties props) {
        Cursor defaultCursor = null;
        File bestand = new File(props.getProperty("aanvalsCursor"));
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        try {
            Image cursorImage = new ImageIcon(ImageIO.read(bestand)).getImage();
            defaultCursor = toolkit.createCustomCursor(cursorImage, new Point(1, 1), "aanvalsCursor");
        } catch (Exception ex) {
        }
        return defaultCursor;
    }

    public Cursor maakBeweegCursor(Properties props) {
        Cursor defaultCursor = null;
        File bestand = new File(props.getProperty("beweegCursor"));
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        try {
            Image cursorImage = new ImageIcon(ImageIO.read(bestand)).getImage();
            defaultCursor = toolkit.createCustomCursor(cursorImage, new Point(1, 1), "beweegCursor");
        } catch (Exception ex) {
        }
        return defaultCursor;

    }

    public Cursor maakNietToegelatenCursor(Properties props) {
        Cursor defaultCursor = null;
        File bestand = new File(props.getProperty("nietToegelatenCursor"));
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        try {
            Image cursorImage = new ImageIcon(ImageIO.read(bestand)).getImage();
            defaultCursor = toolkit.createCustomCursor(cursorImage, new Point(1, 1), "nietToegelatenCursor");
        } catch (Exception ex) {
        }
        return defaultCursor;

    }

    public Cursor maakSelecteerCursor(Properties props) {
        Cursor defaultCursor = null;
        File bestand = new File(props.getProperty("selecteerCursor"));
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        try {
            Image cursorImage = new ImageIcon(ImageIO.read(bestand)).getImage();
            defaultCursor = toolkit.createCustomCursor(cursorImage, new Point(1, 1), "selecteerCursor");
        } catch (Exception ex) {
        }
        return defaultCursor;

    }

    public Cursor getAanvalsCursor() {
        return aanvalsCursor;
    }

    public Cursor getBeweegCursor() {
        return beweegCursor;
    }

    public Cursor getNietToegelatenCursor() {
        return nietToegelatenCursor;
    }

    public Cursor getSelecteerCursor() {
        return selecteerCursor;
    }
}
